import storageApi from '../../core/storage/storage';

function SelectOneWorkerController($rootScope, $scope, globalService, patrolService) {
  'ngInject';

  /*eslint-disable */
  // 获取单位
  this.queryAllUnit = () => {
    if (this.unitList) {
      return;
    };
    globalService
      .queryAllOrg()
      .then((res) => {
        if (res.success) {
          this.unitList = res.data.list;
        }
      });
  }

 this.queryAllUnit();

  // 获取单位下的员工
  this.queryWorker = () => {
    const id = this.department;
    globalService
      .queryOrgWorker(id)
      .then((res) => {
        if (res.success) {
          this.workerList = res.data;
        }
      });
  }


}

export default SelectOneWorkerController;
